package com.lwj.liwanjia.view.activity.work.fang_dong;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.lwj.liwanjia.R;
import com.lwj.liwanjia.base.BaseActivity;
import com.lwj.liwanjia.view.activity.work.shang_jia.ding_dan.DingDanHome01Activity;
import com.lwj.liwanjia.view.activity.work.shang_jia.PinLunHomeActivity;
import com.lwj.liwanjia.view.activity.work.shang_jia.ShangPingHomeActivity;

/**
 * Created by 001 on 2017/9/19.
 */

public class FangDongHomeActivity extends BaseActivity implements View.OnClickListener {

    private TextView tv_back;
    private TextView tv_title;
    private ImageView iv_right;
    private RelativeLayout rl_faBu;//发布
    private RelativeLayout rl_dingDan;//订单
    private RelativeLayout rl_pingLun;//评论
    private RelativeLayout rl_changJianWenTi;//常见问题

    @Override
    protected void initView() {

        tv_back = (TextView) findViewById(R.id.tv_left);
        tv_title = (TextView) findViewById(R.id.tv_title);
        iv_right = (ImageView) findViewById(R.id.iv_right);

        rl_faBu = (RelativeLayout) findViewById(R.id.rl_faBu);
        rl_dingDan = (RelativeLayout) findViewById(R.id.rl_dingDan);
        rl_pingLun = (RelativeLayout) findViewById(R.id.rl_pingLun);
        rl_changJianWenTi = (RelativeLayout) findViewById(R.id.rl_changJianWenTi);

        tv_back.setVisibility(View.VISIBLE);
        tv_title.setVisibility(View.VISIBLE);
        iv_right.setVisibility(View.VISIBLE);
        iv_right.setImageResource(R.mipmap.xiaoxi);
        tv_title.setText("我是房东");

        tv_back.setOnClickListener(this);
        iv_right.setOnClickListener(this);
        rl_faBu.setOnClickListener(this);
        rl_dingDan.setOnClickListener(this);
        rl_pingLun.setOnClickListener(this);
        rl_changJianWenTi.setOnClickListener(this);

    }

    @Override
    protected void initData() {


    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_fang_dong_home;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //返回
            case R.id.tv_left:
                finish();
                break;
            //信息
            case R.id.iv_right:
                Toast.makeText(this, "弹出信息", Toast.LENGTH_LONG).show();
                break;
            //发布
            case R.id.rl_faBu:
                startActivity(new Intent(this, ShangPingHomeActivity.class));
                break;
            //订单
            case R.id.rl_dingDan:
                startActivity(new Intent(this, DingDanHome01Activity.class));
                break;
            //评论
            case R.id.rl_pingLun:
                startActivity(new Intent(this, PinLunHomeActivity.class));
                break;
            //常见问题
            case R.id.rl_changJianWenTi:
                Toast.makeText(this, "暂未开放", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
